export const schema = {
  title: "修改密码",
  body: [
    {
      type: 'grid',
      columns: [
        {
          md: 6,
          sm: 6,
          type: "form",
          mode: "horizontal",
          title: "修改密码",
          panelClassName: "panel-default",
          api: '/api/user/newpwd',
          horizontal: {
            left: "col-sm-3",
            right: "col-sm-9",
            offset: "col-sm-offset-3"
          },
          controls: [
            {
              label: "原密码",
              type: "password",
              name: "orgin_pwd",
              required: true
            },

            {
              label: "新密码",
              type: "password",
              name: "pwd",
              required: true
            },

            {
              label: "确认新密码",
              type: "password",
              name: "pwd_confirm",
              required: true
            },

            {
              label: "修改密码",
              type: "submit",
              primary: true
            }
          ]
        }
      ]
    },

    {
      type: 'grid',
      columns: [
        {
          md: 6,
          type: "form",
          mode: "horizontal",
          title: "绑定手机",
          panelClassName: "panel-default",
          api: '/api/user/bindphone',
          horizontal: {
            left: "col-sm-3",
            right: "col-sm-9",
            offset: "col-sm-offset-3"
          },
          controls: [
            {
              type: 'static',
              label: '已绑定手机号',
              name: 'phone',
              visibleOn: 'data.user.phone',
              tpl: '${user.phone}'
            },
            {
              label: "手机",
              type: "text",
              name: "phone",
              required: true
            },

            {
              label: "短信验证码",
              type: "phone-code",
              name: "code",
              sendApi: 'post:/api/user/verifyphone',
              phoneFieldName: "phone",
              width: 170,
              required: true
            },

            {
              label: "绑定手机",
              type: "submit",
              primary: true
            }
          ]
        }
      ]
    }
  ]
};
